<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/displaytag-11.tld" prefix="display"%>
<html>
  <head>
    
    <title>ConsultarSede</title>
    <link href="<%= request.getContextPath() + "/css/bloques.css" %>" rel="stylesheet" type="text/css">
    <script language="javascript">
      function destino(target){
        //alert(target);
        document.frmConsultarSede.action = target;
        document.frmConsultarSede.submit();
      }
    </script>
  </head>
  <body>
    
    <DIV align="center">
      <table cellspacing="2" cellpadding="1" border="0" width="80%" align="center">
        <tr>
          <td align="center" class="titulosenblanco">ADMINISTRACION DE SEDES</td>
        </tr>
      </table>
    </DIV>
    
    <form name="frmConsultarSede" method="POST">
        
        <table width="60%" border="0" cellpadding="0" cellspacing="0" align="center">
            <tr>
              <td align="center" width="25%">
                <input type="image" src="<%= request.getContextPath() + "/images/b_nuevo.gif" %>" alt="Nueva Sede" onclick="destino('<%=request.getContextPath() + "/Sedes/IngresarSede.do"%>')" />
                <br/>
                  <span>Crear una Sede</span>
              </td>
              <td align="center" width="25%">
                  <input type="image" src="<%= request.getContextPath() + "/images/activar.gif" %>" alt="Asignar Beneficios" onclick="destino('<%=request.getContextPath() + "/Sedes/BeneficiosSede.do"%>')" />
                  <br/>
                  <span>Asignar Beneficios</span>
               
              </td>
           <!--   <td align="center" width="25%">
                  <input type="image" src="<%= request.getContextPath() + "/images/b_nuevo.gif" %>" alt="Asignar" onclick="destino('<%=request.getContextPath() + "/Sedes/UsuarioSubprograma.do"%>')" />
                  <br/>
                  <span>Asignar Usuarios a un Beneficio</span>
               
              </td> -->
            </tr>
          </table>
       <br/>
      <table cellspacing="3" cellpadding="3" border="0" width="50%" align="center">
        <tr>
          <td class="celdatabla">
            <STRONG>Nombre</STRONG>
          </td>
          <td colspan="2">
            <input type="text"  class="form" name="Sede" maxlength="50" size="35"/>
          </td>
        </tr>
       
        <tr>
          <td colspan="2"></td>
          <td>
            <input type="button" onclick="destino('ConsultarSedes.do')" value="Consultar"/> 
          </td>  
        </tr>
      </table>
      <P align="center">
      <%  
        if(session.getAttribute("mensajes") != null){
          out.println((String)session.getAttribute("mensajes"));
        }
          session.removeAttribute("mensajes");
      %>
      </P>
      <DIV align="center">
 
      
        <logic:notPresent scope="request" name="sedes">
            <logic:present scope="request" name="msg">
              <DIV align="center"><%=request.getAttribute("msg")%></DIV>
            </logic:present>
        </logic:notPresent>
      
        <logic:present scope="request" name="sedes"> 
            <table  cellspacing="3" cellpadding="2" border="0" width="90%" align="center">
              <tr>
                <td>
                  <display:table name="requestScope.sedes"  requestURI='<%= request.getContextPath() + "/Sedes/ConsultarSedes.do" %>' class="bordesTable" pagesize="20" id="sede" cellpadding="3" cellspacing="1"  style="width:100%">
                      <display:column headerClass="headerTable" title="Sede" class="Numero" sortable="false">
                        <html:link paramId="Codigo" paramName="sede" paramProperty="code" page="/Sedes/ModificarSede.do">
                          <bean:write name="sede" property="nombre"/> 
                        </html:link> 
                      </display:column>
                      <display:column headerClass="headerTable" title="Modificar" class="Numero">
                        <html:link paramId="Codigo" paramName="sede" paramProperty="code" page="/Sedes/ModificarSede.do">
                             <div align="center"><img src="<%= request.getContextPath() + "/images/modificar.gif" %>" width="16" height="16" border="0"></div>
                        </html:link>       
                    </display:column>	
                    <bean:define id="Codigo" name="sede" property="code"></bean:define>
                    <bean:define id="Nombre" name="sede" property="nombre"></bean:define>
                          <%
                            java.util.HashMap params = new java.util.HashMap();
                            params.put("Codigo", Codigo);
                            params.put("Nombre", Nombre);
                            pageContext.setAttribute("parametros", params);
                          %>
                    <display:column headerClass="headerTable" title="Ver Usuarios" class="Numero">
                       <html:link name="parametros" scope="page" page="/Sedes/UsuariosxSede.do">
                             <div align="center"><img src="<%= request.getContextPath() + "/images/usuario.gif" %>" width="16" height="16" border="0"></div>
                        </html:link>       
                    </display:column>	
                    <display:column headerClass="headerTable" title="Desactivar" class="Numero">
                        <html:link paramId="Codigo" onclick="return confirm('Esta seguro que desea eliminar la Sede?')" paramName="sede" paramProperty="code" page="/Sedes/EliminarSede.do">
                             <div align="center"><img src="<%= request.getContextPath() + "/images/Delete.gif" %>" width="16" height="16" border="0"></div>
                        </html:link>       
                    </display:column>	
                  </display:table>
                </td>
              </tr>
            </table>
          </logic:present> 
      </DIV>
    </form>
  </body>
</html>
